package com.github.edu.db.manager.config.controller;

import com.github.edu.db.manager.config.service.impl.TableFieldManagerServiceImpl;
import com.github.edu.db.server.api.service.TableFieldManagerServiceApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Create by IntelliJ IDEA
 * 用户：王建
 * 日期：2018-7-30
 */
@RestController
public class TableFieldManagerRestController implements TableFieldManagerServiceApi {

    @Autowired
    private TableFieldManagerServiceImpl server;

    @Override
    public String getEntity(String id) {
        return server.getEntity(id);
    }

    @Override
    public String saveOrUpdate(@RequestBody String jsonEntity) {

        return server.saveOrUpdate(jsonEntity);
    }

    @Override
    public String getAllByPager(String title, Integer current, Integer rows, String order, String fileId) {
        return server.getAllGetEntity(title,current,rows,order,fileId);
    }

    @Override
    public String getALLByPager(@RequestBody String jsonEntity) {
        return server.getALLPostByPager(jsonEntity);
    }

    @Override
    public String getAllEntity(String title, String order, String fileId) {
        return server.getAllEntity(title,order,fileId);
    }

    @Override
    public String deleteAll(String ids) {
        return server.delete(ids);
    }
}
